package com.xique.door.api;

import com.xique.common.core.constant.ServiceNameConstants;
import com.xique.common.core.web.domain.AjaxResult;
import com.xique.door.api.factory.RemoteDeviceFallbackFactory;
import com.xique.door.api.request.device.RemoteDeviceAddRequest;
import com.xique.door.api.request.device.RemoteDeviceListRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author shd
 * @create 2022/3/10 15:26
 */
@FeignClient(contextId = "RemoteDeviceService", value = ServiceNameConstants.DOOR_BIZ_SERVICE, fallbackFactory = RemoteDeviceFallbackFactory.class)
public interface RemoteDeviceService {

    /**
     * 设备列表
     * @author shd
     * @date 2022/3/10 15:46
     * @param request
     * @return com.xique.common.core.web.domain.AjaxResult
     */
    @PostMapping("device/openApi/v1/list")
    AjaxResult getDeviceList(@RequestBody RemoteDeviceListRequest request);

    /**
     * 添加设备
     * @author shd
     * @date 2022/3/11 13:36
     * @param request
     * @return com.xique.common.core.web.domain.AjaxResult
     */
    @PostMapping("device/openApi/v1/add")
    AjaxResult addDevice(@RequestBody RemoteDeviceAddRequest request);
}
